package com.pengxun.manager.enums;

/**
 * @author liangpusheng
 * @date 2019/11/25 16:35
 */
public enum PermissionCodeTypeEnums {

    INSERT("insert","新增"),
    UPDATE("update","编辑"),
    DELETE("delete","删除"),
    SELECT("select","查询"),
    UPDATESTATUS("updateStatus","禁用/启用"),
    IMPORT("import","导入"),
    EXPORT("export","导出"),
    DOWNLOAD("download","下载"),
    GRANT("grant","权限分配"),
    AUDIT("audit","审核"),
    VIEW("view","查看"),
    DETAIL("detail","详情"),
    CREATECODE("createCode","生码"),
    RESETPASSWORD("resetPassword","重置密码"),
    FUNCTION("function","功能"),
    API("api","管理接口"),
    SETTINGPASSWORD("settingPassword","设置密码");

    public static PermissionCodeTypeEnums getEnumByType(String codeType){
        PermissionCodeTypeEnums[] enums = PermissionCodeTypeEnums.values();
        for (PermissionCodeTypeEnums permissionCodeTypeEnum:enums){
            if(permissionCodeTypeEnum.getCodeType().equals( codeType)){
                return permissionCodeTypeEnum;
            }
        }
        return null;
    }

    private String codeType;
    private String codeTypeName;
    public String getCodeType() {
        return codeType;
    }
    public void setCodeType(String codeType) {
        this.codeType = codeType;
    }
    public String getCodeTypeName() {
        return codeTypeName;
    }
    public void setCodeTypeName(String codeTypeName) {
        this.codeTypeName = codeTypeName;
    }
    private PermissionCodeTypeEnums(String codeType, String codeTypeName) {
        this.codeType = codeType;
        this.codeTypeName = codeTypeName;
    }
}
